
import React, { Component } from 'react';
import eventBus from "@/utils/eventBus";

export default class Son extends Component {

  chuanB=()=>{
    eventBus.publish("onChuan",2);
  }

  render() {
    return (
      <div>
        <h1>子组件A</h1>
        <input type="button" value="传给兄弟B" onClick={this.chuanB} />
      </div>
    )
  }
}